package com.ruoyi.coupon.api.factory;

import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.coupon.api.RemoteCouponService;
import com.ruoyi.coupon.api.domain.MemberPrice;
import com.ruoyi.coupon.api.domain.SkuFullReduction;
import com.ruoyi.coupon.api.domain.SkuLadder;
import com.ruoyi.coupon.api.domain.SpuBounds;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * Author：汤小洋
 * Date：2023-11-28 14:14
 * Description：<描述>
 */
@Component
public class RemoteCouponFallbackFactory implements FallbackFactory<RemoteCouponService> {

    @Override
    public RemoteCouponService create(Throwable throwable) {
        return new RemoteCouponService() {
            @Override
            public AjaxResult saveSkuLadder(SkuLadder skuLadder) {
                return AjaxResult.error("保存阶梯价格失败:" + throwable.getMessage());
            }

            @Override
            public AjaxResult saveSkuFullReduction(SkuFullReduction skuFullReduction) {
                return null;
            }

            @Override
            public AjaxResult saveMemberPrice(MemberPrice memberPrice) {
                return null;
            }

            @Override
            public AjaxResult saveSpuBounds(SpuBounds spuBounds) {
                return null;
            }
        };
    }

}
